/*
 * @Author: dudu
 * @Date: 2022-06-07 14:38:25
 * @LastEditors: dudu
 * @LastEditTime: 2022-06-09 16:23:16
 * @Description: 
 */
import req from "./axioscommon";
import req1 from "./axioscommon1";

/** 
 * @Description 618活动
 */
export const activityDrawNums = (params) => {
    // debugger
    console.log(params)
    return req({
        baseUrl: 'activity'
    }).get(`/activityDrawNums?activityId=${params.activityId}&userId=${params.userId}&r=${getRandomStar()}`, params);
};

export const draw = (params) => {
    // debugger
    return req1({
        baseUrl: 'point'
    }).post(`/Draw?r=${getRandomStar()}`, params);
};

export const reDrawNums = (params) => {
    return req({
        baseUrl: 'activity'
    }).put(`/reDrawNums/${params.userId}/${params.activityId}?r=${getRandomStar()}`);
};

export const dealDrawNums = (params) => {
    return req({
        baseUrl: 'activity'
    }).put(`/dealDrawNums/${params.userId}/${params.activityId}?r=${getRandomStar()}`);
};


function getRandomStar() {
    const r = Math.random().toString(36).substring(2)
    return r
}